
point-swap.o:     file format elf64-littleaarch64


Disassembly of section .text:

0000000000000000 <swap_w>:




void swap_w( int a, int b )
{  
   0:	d10083ff 	sub	sp, sp, #0x20
   4:	b9000fe0 	str	w0, [sp, #12] ; a
   8:	b9000be1 	str	w1, [sp, #8]  ; b
    int temp; 
	
    temp = a;  
   c:	b9400fe0 	ldr	w0, [sp, #12] ; a
  10:	b9001fe0 	str	w0, [sp, #28] ; temp
    a = b;  
  14:	b9400be0 	ldr	w0, [sp, #8] ; b
  18:	b9000fe0 	str	w0, [sp, #12] ; a = b
    b = temp;   
  1c:	b9401fe0 	ldr	w0, [sp, #28] ; temp
  20:	b9000be0 	str	w0, [sp, #8]  ; b = temp
} 
  24:	d503201f 	nop
  28:	910083ff 	add	sp, sp, #0x20
  2c:	d65f03c0 	ret

0000000000000030 <swap_p>:

void swap_p( int *a, int *b )
{  
  30:	d10083ff 	sub	sp, sp, #0x20
  34:	f90007e0 	str	x0, [sp, #8] ; a
  38:	f90003e1 	str	x1, [sp]     ; b
    int *temp; 
	
    temp = NULL;  
  3c:	f9000fff 	str	xzr, [sp, #24] ; temp
    temp = a;  
  40:	f94007e0 	ldr	x0, [sp, #8] ; a
  44:	f9000fe0 	str	x0, [sp, #24] ; temp = a
    a = b;  
  48:	f94003e0 	ldr	x0, [sp]
  4c:	f90007e0 	str	x0, [sp, #8]
    b = temp;   
  50:	f9400fe0 	ldr	x0, [sp, #24]
  54:	f90003e0 	str	x0, [sp]
}  
  58:	d503201f 	nop
  5c:	910083ff 	add	sp, sp, #0x20
  60:	d65f03c0 	ret

0000000000000064 <swap_px>:

void swap_px( int *a, int *b )
{  
  64:	a9bd7bfd 	stp	x29, x30, [sp, #-48]!
  68:	910003fd 	mov	x29, sp
  6c:	f9000fa0 	str	x0, [x29, #24] ; a
  70:	f9000ba1 	str	x1, [x29, #16] ; b
    int *temp; 
	
	printf("swap_px1 %d %d\n", *a, *b);	// 16 32
  74:	f9400fa0 	ldr	x0, [x29, #24] ; a
  78:	b9400001 	ldr	w1, [x0]       ; *a
  7c:	f9400ba0 	ldr	x0, [x29, #16] ; b
  80:	b9400002 	ldr	w2, [x0]       ; *b
  84:	90000000 	adrp	x0, 0 <swap_w>
  88:	91000000 	add	x0, x0, #0x0
  8c:	94000000 	bl	0 <printf>
    *temp = *a;  
  90:	f9400fa0 	ldr	x0, [x29, #24] ; a
  94:	b9400001 	ldr	w1, [x0]       ; *a
  98:	f94017a0 	ldr	x0, [x29, #40] ; temp
  9c:	b9000001 	str	w1, [x0]       ; *temp = *a
	printf("swap_px2 %d %d %d\n", *a, *b, *temp);	// 16 32 16
  a0:	f9400fa0 	ldr	x0, [x29, #24]
  a4:	b9400001 	ldr	w1, [x0]
  a8:	f9400ba0 	ldr	x0, [x29, #16]
  ac:	b9400002 	ldr	w2, [x0]
  b0:	f94017a0 	ldr	x0, [x29, #40]
  b4:	b9400003 	ldr	w3, [x0]
  b8:	90000000 	adrp	x0, 0 <swap_w>
  bc:	91000000 	add	x0, x0, #0x0
  c0:	94000000 	bl	0 <printf>
    *a = *b;  
  c4:	f9400ba0 	ldr	x0, [x29, #16] ; b
  c8:	b9400001 	ldr	w1, [x0]       ; *b
  cc:	f9400fa0 	ldr	x0, [x29, #24] ; a
  d0:	b9000001 	str	w1, [x0]       ; *a = *b
	printf("swap_px3 %d %d %d\n", *a, *b, *temp);	// 32 32 32
  d4:	f9400fa0 	ldr	x0, [x29, #24]
  d8:	b9400001 	ldr	w1, [x0]
  dc:	f9400ba0 	ldr	x0, [x29, #16]
  e0:	b9400002 	ldr	w2, [x0]
  e4:	f94017a0 	ldr	x0, [x29, #40]
  e8:	b9400003 	ldr	w3, [x0]
  ec:	90000000 	adrp	x0, 0 <swap_w>
  f0:	91000000 	add	x0, x0, #0x0
  f4:	94000000 	bl	0 <printf>
    *b = *temp;   
  f8:	f94017a0 	ldr	x0, [x29, #40]
  fc:	b9400001 	ldr	w1, [x0]
 100:	f9400ba0 	ldr	x0, [x29, #16]
 104:	b9000001 	str	w1, [x0]
	printf("swap_px4 %d %d %d\n", *a, *b, *temp);	// 32 32 32
 108:	f9400fa0 	ldr	x0, [x29, #24]
 10c:	b9400001 	ldr	w1, [x0]
 110:	f9400ba0 	ldr	x0, [x29, #16]
 114:	b9400002 	ldr	w2, [x0]
 118:	f94017a0 	ldr	x0, [x29, #40]
 11c:	b9400003 	ldr	w3, [x0]
 120:	90000000 	adrp	x0, 0 <swap_w>
 124:	91000000 	add	x0, x0, #0x0
 128:	94000000 	bl	0 <printf>
}  
 12c:	d503201f 	nop
 130:	a8c37bfd 	ldp	x29, x30, [sp], #48
 134:	d65f03c0 	ret

0000000000000138 <swap_pp>:

void swap_pp( int **a, int **b )
{
 138:	d10083ff 	sub	sp, sp, #0x20
 13c:	f90007e0 	str	x0, [sp, #8] ; a
 140:	f90003e1 	str	x1, [sp]     ; b
    int *tmp = NULL; 
 144:	f9000fff 	str	xzr, [sp, #24] ; tmp
	
    tmp = *a;  
 148:	f94007e0 	ldr	x0, [sp, #8] ; a
 14c:	f9400000 	ldr	x0, [x0]     ; *a
 150:	f9000fe0 	str	x0, [sp, #24] ; tmp = *a
    *a = *b;  
 154:	f94003e0 	ldr	x0, [sp] ; b
 158:	f9400001 	ldr	x1, [x0] ; *b
 15c:	f94007e0 	ldr	x0, [sp, #8] ; a
 160:	f9000001 	str	x1, [x0]     ; *a = *b
    *b = tmp;  
 164:	f94003e0 	ldr	x0, [sp]
 168:	f9400fe1 	ldr	x1, [sp, #24]
 16c:	f9000001 	str	x1, [x0]
}
 170:	d503201f 	nop
 174:	910083ff 	add	sp, sp, #0x20
 178:	d65f03c0 	ret

000000000000017c <test_swap_pp>:

void test_swap_pp()
{
 17c:	a9bd7bfd 	stp	x29, x30, [sp, #-48]!
 180:	910003fd 	mov	x29, sp
	int a,b;  
	int *pa, *pb;

    a = 16;  
 184:	52800200 	mov	w0, #0x10                  	// #16
 188:	b9002fa0 	str	w0, [x29, #44]              ; a
    b = 32;  
 18c:	52800400 	mov	w0, #0x20                  	// #32
 190:	b9002ba0 	str	w0, [x29, #40]              ; b

	pa = &a;
 194:	9100b3a0 	add	x0, x29, #0x2c ; &a
 198:	f90013a0 	str	x0, [x29, #32] ; pa
	pb = &b;
 19c:	9100a3a0 	add	x0, x29, #0x28 ; &b
 1a0:	f9000fa0 	str	x0, [x29, #24] ; pb

	swap_pp(&pa, &pb); 	
 1a4:	910063a1 	add	x1, x29, #0x18 ; &pb
 1a8:	910083a0 	add	x0, x29, #0x20 ; &pa
 1ac:	94000000 	bl	138 <swap_pp>
	printf("%d\n", *pa - *pb);	// 16
 1b0:	f94013a0 	ldr	x0, [x29, #32]
 1b4:	b9400001 	ldr	w1, [x0]
 1b8:	f9400fa0 	ldr	x0, [x29, #24]
 1bc:	b9400000 	ldr	w0, [x0]
 1c0:	4b000021 	sub	w1, w1, w0
 1c4:	90000000 	adrp	x0, 0 <swap_w>
 1c8:	91000000 	add	x0, x0, #0x0
 1cc:	94000000 	bl	0 <printf>
	printf("%d\n", a - b);		// -16
 1d0:	b9402fa1 	ldr	w1, [x29, #44]
 1d4:	b9402ba0 	ldr	w0, [x29, #40]
 1d8:	4b000021 	sub	w1, w1, w0
 1dc:	90000000 	adrp	x0, 0 <swap_w>
 1e0:	91000000 	add	x0, x0, #0x0
 1e4:	94000000 	bl	0 <printf>
}
 1e8:	d503201f 	nop
 1ec:	a8c37bfd 	ldp	x29, x30, [sp], #48
 1f0:	d65f03c0 	ret

00000000000001f4 <main>:

int main ( int argc, char **argv )
{  
 1f4:	a9bd7bfd 	stp	x29, x30, [sp, #-48]!
 1f8:	910003fd 	mov	x29, sp
 1fc:	b9001fa0 	str	w0, [x29, #28]
 200:	f9000ba1 	str	x1, [x29, #16]
    int a,b;  

    a = 16;  
 204:	52800200 	mov	w0, #0x10                  	// #16
 208:	b9002fa0 	str	w0, [x29, #44]
    b = 32;  
 20c:	52800400 	mov	w0, #0x20                  	// #32
 210:	b9002ba0 	str	w0, [x29, #40]

	swap_w(a, b); 	
 214:	b9402fa0 	ldr	w0, [x29, #44]
 218:	b9402ba1 	ldr	w1, [x29, #40]
 21c:	94000000 	bl	0 <swap_w>
	printf("%d\n", a - b);	// -16
 220:	b9402fa1 	ldr	w1, [x29, #44]
 224:	b9402ba0 	ldr	w0, [x29, #40]
 228:	4b000021 	sub	w1, w1, w0
 22c:	90000000 	adrp	x0, 0 <swap_w>
 230:	91000000 	add	x0, x0, #0x0
 234:	94000000 	bl	0 <printf>

	a = 16;  
 238:	52800200 	mov	w0, #0x10                  	// #16
 23c:	b9002fa0 	str	w0, [x29, #44]
    b = 32; 
 240:	52800400 	mov	w0, #0x20                  	// #32
 244:	b9002ba0 	str	w0, [x29, #40]
    swap_p(&a, &b); 	
 248:	9100a3a1 	add	x1, x29, #0x28
 24c:	9100b3a0 	add	x0, x29, #0x2c
 250:	94000000 	bl	30 <swap_p>
	printf("%d\n", a - b);	// -16
 254:	b9402fa1 	ldr	w1, [x29, #44]
 258:	b9402ba0 	ldr	w0, [x29, #40]
 25c:	4b000021 	sub	w1, w1, w0
 260:	90000000 	adrp	x0, 0 <swap_w>
 264:	91000000 	add	x0, x0, #0x0
 268:	94000000 	bl	0 <printf>

	a = 16;  
 26c:	52800200 	mov	w0, #0x10                  	// #16
 270:	b9002fa0 	str	w0, [x29, #44]
    b = 32; 
 274:	52800400 	mov	w0, #0x20                  	// #32
 278:	b9002ba0 	str	w0, [x29, #40]
	swap_px(&a, &b); 	
 27c:	9100a3a1 	add	x1, x29, #0x28
 280:	9100b3a0 	add	x0, x29, #0x2c
 284:	94000000 	bl	64 <swap_px>
	printf("%d\n", a - b);	// 0
 288:	b9402fa1 	ldr	w1, [x29, #44]
 28c:	b9402ba0 	ldr	w0, [x29, #40]
 290:	4b000021 	sub	w1, w1, w0
 294:	90000000 	adrp	x0, 0 <swap_w>
 298:	91000000 	add	x0, x0, #0x0
 29c:	94000000 	bl	0 <printf>

	test_swap_pp();
 2a0:	94000000 	bl	17c <test_swap_pp>
	

    return 0;  
 2a4:	52800000 	mov	w0, #0x0                   	// #0
}
 2a8:	a8c37bfd 	ldp	x29, x30, [sp], #48
 2ac:	d65f03c0 	ret
